package com.emode.action;

import java.util.List;

import com.emode.base.BaseAction;
import com.emode.entity.Bbssection;
import com.opensymphony.xwork2.ActionContext;

public class SectionAction extends BaseAction<Bbssection>{
	/**
	 * 
	 */
	private static final long serialVersionUID = -779718806284708205L;
	private List list;
	@Override
	public List getList() {
		return list;
	}
	@Override
	public void setList(List list) {
		this.list = list;
	}
	
	//显示所有的版块
	public String listAll(){
		System.out.println("section");
		list = sectionservice.findAll();
		ActionContext.getContext().getValueStack().push(list);
		return "tohome";
		
	}
	//添加一个版块
	public String add(){
		sectionservice.save(model);
		return "tolist";
	}
	//修改一个版块
	//删除一个版块
	public String del(){
		sectionservice.deleteByIds(model.getSid());;
		return "tolist";
		
	}

}
